From 1e0ca71ecad59f4349837b1858dc8d2c27155c33 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 31 Jan 2016 14:08:35 -0500 Subject: [PATCH] reftests: Make label-text-shadow-changes-modify-clip test more reliable This test was failing in continuous, where the tests are running in a VM with disabled animations. Make the test adapt to that situation by changing the rui on the fly if we find that animations are disabled. --- .../label-text-shadow-changes-modify-clip.c | 18 ++++++++++++++++++ .../label-text-shadow-changes-modify-clip.ui | 1 + 2 files changed, 19 insertions(+) diff --git a/testsuite/reftests/label-text-shadow-changes-modify-clip.c b/testsuite/reftests/label-text-shadow-changes-modify-clip.c index 0507c36c44..bfb2d6028c 100644 --- a/testsuite/reftests/label-text-shadow-changes-modify-clip.c +++ b/testsuite/reftests/label-text-shadow-changes-modify-clip.c @@ -88,3 +88,21 @@ inhibit_for_3_frames (GtkWidget *widget) return FALSE; } + +G_MODULE_EXPORT gboolean +add_reference_class_if_no_animation (GtkWidget *widget) +{ + gboolean enabled; + GtkStyleContext *context; + + g_object_get (gtk_widget_get_settings (widget), "gtk-enable-animations", &enabled, NULL); + if (enabled) + return FALSE; + + g_message ("Adding reference class because animation is disabled"); + + context = gtk_widget_get_style_context (widget); + gtk_style_context_add_class (context, "reference"); + + return FALSE; +} diff --git a/testsuite/reftests/label-text-shadow-changes-modify-clip.ui b/testsuite/reftests/label-text-shadow-changes-modify-clip.ui index 0d029fd0a2..3acad7e636 100644 --- a/testsuite/reftests/label-text-shadow-changes-modify-clip.ui +++ b/testsuite/reftests/label-text-shadow-changes-modify-clip.ui @@ -20,6 +20,7 @@ True False Hello World + False -- 2.30.2